﻿@using CodeGenerator.Core
@using System.Text
@{
    BuildHCodeCreate model = Model;
}

@@{
    ViewBag.Title = "@(model.TableInfo.Comments)》表单页面";
    Layout = "~/Views/Shared/_LayoutForm.cshtml";
 }

    <form id="form1" class="form">
    @foreach (CreateFormCode column in model.FormCode)
    {
        string required = "", validate = "";
        if (!string.IsNullOrEmpty(column.UIControlValidator))
        {
            required = "<font face=\"宋体\">*</font>";
            validate = "isvalid=\"yes\" errormsg=\"" + column.Lable + "\" checkexpession=\"" + column.UIControlValidator + "\"";
        }
        if (column.Show)
        {
        @:<div class="col-xs-@column.ControlColspan formItem">
            @:<div class="formTitle">
                @: @column.Lable@RawHtml(required)
            @:</div>
        if (column.UIControlType == "Text")
        {
            @:<input id="@column.Field" maxlength="@column.MaxLength" type="text" class="@column.UIControlStyle" placeholder="请输入@(column.Lable)" @RawHtml(@validate) />
        }
        else if (column.UIControlType == "TextArea")
        {
            @:<textarea id="@column.Field" maxlength="@column.MaxLength" class="form - control" rows="3" @RawHtml(@validate)></textarea>
        }
        else if (column.UIControlType == "Select")
        {
            @:<div id="@column.Field" type="select" class="ui-select" @RawHtml(@validate)></div>
        }
        @:</div>
        }
    }
    </form>

    @@{Html.AppendJsFille(2, "~/Content/Js/@(model.AreaName)/@(model.Name)/Form.js");}